package com.dingup.mock.dao.reading;


import com.dingup.mock.bean.reading.TsReadingQuestion;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Created by yanggavin on 16/3/12.
 */
@Mapper
public interface TsReadingQuestionDAO {
    boolean add(TsReadingQuestion question);

    boolean update(TsReadingQuestion question);

    boolean delete(@Param("id")int id);

    boolean deleteByIdAndSubjectName(@Param("id")Integer id, @Param("subjectName")String subjectName);

    boolean deleteBySubjectNameAndArticleNum(@Param("subjectName")String subjectName, @Param("id")Integer id);

    List<TsReadingQuestion> getQuestions(@Param("subjectName") String subjectName, @Param("articleNum")Integer articleNum);

    TsReadingQuestion getQuestion(@Param("subjectName")String subjectName, @Param("articleNum")Integer articleNum, @Param("questionNum")Integer questionNum);

    List<TsReadingQuestion> getAll();

    List<TsReadingQuestion> getAllByPage(@Param("limit")Integer limit,@Param("offset") Integer offset);

    Integer count();

    TsReadingQuestion getById(Integer id);

    boolean existQuestion(TsReadingQuestion question);

}
